

//cambio de pass

 //cambio de contraseña
    $('#formPersonaPass').validate({
        focusInvalid: false,
        ignore: "",
        rules: {
            pass: {
                minlength: 2,
                required: true
            },
            repass: {
                minlength: 2,
                required: true
            }


        },
        invalidHandler: function(event, validator) {
            //display error alert on form submit  

        },
        errorPlacement: function(label, element) { // render error placement for each input type   
            $('<span class="error"></span>').insertAfter(element).append(label);
            var parent = $(element).parent('.input-with-icon');
            parent.removeClass('success-control').addClass('error-control');
        },
        highlight: function(element) { // hightlight error inputs
            var parent = $(element).parent();
            parent.removeClass('success-control').addClass('error-control');
        },
        unhighlight: function(element) { // revert the change done by hightlight

        },
        success: function(label, element) {
            var parent = $(element).parent('.input-with-icon');
            parent.removeClass('error-control').addClass('success-control');
        },
        submitHandler: function(form) {

            $('#mensaje_form_pass').html("");

            $('#loading').css('visibility', 'visible');
            $.ajax({
                type: 'POST',
                url: $(form).attr('action'),
                data: 'accion=changePass&' + $(form).serialize(),
                // Mostramos un mensaje con la respuesta de PHP
                success: function(data) {
                    if (data[0] === 'E' && data[1] === 'r') {
                        $('#mensaje_form_pass').html(data);
                    } else {
                        $('#mensaje_ok').html(data);
                        $("#formPersonaPass")[0].reset();
                        $('#myModalPasswordADD').modal('hide');

                    }

                    $('#loading').css('visibility', 'hidden');
                    clear(form);
                },
                error: function(data) {
                    $("#error");
                    $('#loading').css('visibility', 'hidden');
                }
            });

        }
    });